COMPILE_TYPE=""
BUILD_COMZIP_ERROR="Error occurs while building apk, build process will stop and exit"
echo ============ BUILD START =============
#Choose compile type
if [ $1 = 'debug' ] ; then
COMPILE_TYPE='debug'
elif [ $1 = 'release' ] ; then
COMPILE_TYPE='release'
else
echo "Invalid compile type, please choose either debug or release"
exit 1
fi

#Build android apk base on compile type
if [ $COMPILE_TYPE = 'release' ] ; then
	echo "compile carpool  component begins"
	echo `pwd`
	ls -al
	cd ./comzuche
	chmod +x build_ubuntu_com.sh 
	sh build_ubuntu_com.sh release
	if [ $? != 0 ] ; then
		echo $BUILD_COMZIP_ERROR
		exit 1
	fi
else
	echo "compile type not supported yet"
	exit 1
fi
